<template>
	<view class="main">
		<form @submit="formSubmit">
			<view class="form">
				<view class="pwd">
					<input type="text" name="pwd" value="" placeholder="请输入旧密码"/>
				</view>
				<view class="pwd">
					<input type="password" name="npwd" value="" placeholder="请输入新密码"/>
				</view>
				<view class="pwd">
					<input type="password"name="z_npwd" value="" placeholder="再次输入新密码" />
				</view>
				<view class="ps">
					请设置6位及以上包含数字字母和特殊符号中至少两种组合的密码
				</view>
			</view>
			<view class="button">
			<button type="error" form-type="submit">确定</button>
			</view>
			<view class="forgot_pwd" @click="router()">
				忘记密码
			</view>
		</form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			}
		},
		methods: {
			router(){
				uni.navigateTo({
					url:'../setpasswrd_2/setpasswrd_2'
				})
			},
			formSubmit: function(e) {
				console.log(e.detail.value)
				var info=e.detail.value
				global.$http.request({
					url: '/api/rider_user/edit_pwd',
					data: {
						token:uni.getStorageSync('token'),
						pwd:info.pwd,
						npwd:info.npwd,
						z_npwd:info.z_npwd,
					}
				}).then(res => {
					console.log(res);
					if(res.data.code==1){
							uni.showToast({
								title: "修改成功",
								icon: "none",
								mask: true,
								duration: 1000
							})
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		font-family: PingFang SC;
		background-color: #f7f7f7;
		.main {
			margin-top: 20rpx;
			.form{
				.pwd{
					background-color: #FFFFFF;
					background: rgba(255, 255, 255, 0.39);
					opacity: 1;
					padding: 34rpx 30rpx;
					margin-bottom: 4rpx;
					input{
						font-size: 32rpx;
						font-weight: 400;
						// color: #999999;
						opacity: 1;
					}
				}
				.ps{
					margin-top: 32rpx;
					text-align: center;
					font-size: 22rpx;
					font-weight: 400;
					line-height: 34rpx;
					color: #BBBBBB;
					opacity: 1;
				}
			
			}
			.button{
				width: 400rpx;
				border-radius: 50rpx !important;
				margin: 110rpx auto 38rpx auto;
				overflow: hidden;
				font-size: 30rpx;
				font-weight: 400;
				opacity: 1;
				background-color: #FF482F;
				button {
					color: #fff !important;
				}
			}
			.forgot_pwd{
				font-size: 24rpx;
				font-weight: 400;
				color: #999999;
				text-align: center;
				opacity: 1;
			}
		}
	}
</style>
